import React,{Component} from 'react';
import {
  View,
  Text,
  Image,
  TouchableHighlight,
  StyleSheet
} from 'react-native';

export default class ViewUtils {
  /**
  * 获取设置页的Item
  * @param callBack 单击 item 的回调
  * @param icon 左侧图标
  * @param text 显示的文本
  * @param tinStyle 图标颜色
  * @param expandableIcon 右侧图标
  **/
  static getSettingItem(callBack,icon,text,tintStyle,expandableIcon){
    return (
      <TouchableHighlight onPress={callBack}>
          <View style={styles.setting_item_container}>
            <View style={{flexDirection:'row',alignItems:'center'}}>
              <Image
               style={[{width:40,height:40,marginLeft:10},{tintColor: tintStyle}]} 
               source={icon} />
              <Text >{text}</Text>
            </View>
            <Image 
              style={[{width:22,height:22,marginRight:10},{tintColor:tintStyle }]} 
              source={expandableIcon?expandableIcon:require('../assets/images/right.png')} 
            />
          </View>
       </TouchableHighlight>
    )
  }
}
const styles = StyleSheet.create({
  setting_item_container:{ 
    justifyContent:'space-between',
    flexDirection:'row',
    alignItems:'center',
  },
})